package com.cskaoyan.service.comment.wx;

import com.cskaoyan.bean.Comment;
import com.cskaoyan.mapper.CommentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    CommentMapper commentMapper;

    @Override
    public Comment selectByPrimaryKey(int id) {
        return commentMapper.selectByPrimaryKey(id);
    }

    @Override
    public boolean post(Comment comment) {
        int insert = commentMapper.insert(comment);
        return 1 == insert;
    }

    @Override
    public int getLastInsertId() {
        int i = commentMapper.selectMaxId();
        return i;
    }
}
